Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(beforeSave): Skip Sanitizing Database results #7003

Merged
merged 2 commits into from
Nov 12, 2020

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Nov 11, 2020

I've been running into Internal Server Error when using beforeSave and nested objects.

Uncaught exception: TypeError: Cannot read property 'split' of undefined

error: Uncaught internal server error. Cannot read property 'number' of undefined

When using beforeSave there is a validation permission check. If an object exists it returns {} and does additional checks on an empty object. ValidateOnly. I believe we can ignore those checks as they don’t have anything to do with beforeSave.

Let me know if additional tests are needed.

@codecov
Copy link

codecov bot commented Nov 11, 2020

Codecov Report

Merging #7003 (2b7534d) into master (568c285) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7003   +/-   ##
=======================================
  Coverage   93.81%   93.81%           
=======================================
  Files         169      169           
  Lines       12405    12405           
=======================================
  Hits        11638    11638           
  Misses        767      767           
Impacted Files Coverage Δ
src/RestWrite.js 93.82% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 568c285...2b7534d. Read the comment docs.

@dplewis
Copy link
Member Author

dplewis commented Nov 11, 2020

Closes #6358

Will open a separate PR to handle nested objects values properly returning in beforeSave

Copy link
Member

@davimacedo davimacedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

@davimacedo davimacedo merged commit a4c84c0 into master Nov 12, 2020
@davimacedo davimacedo deleted the sanitize-beforeSave branch November 12, 2020 01:39
@dplewis dplewis linked an issue Nov 12, 2020 that may be closed by this pull request
mtrezza added a commit to mtrezza/parse-server that referenced this pull request Dec 4, 2020
* commit 'ccb045b68c5b4d983a90fa125513fc476e4e2387':
  fix: upgrade @graphql-tools/links from 6.2.4 to 6.2.5 (parse-community#7007)
  fix: upgrade pg-promise from 10.7.0 to 10.7.1 (parse-community#7009)
  fix: upgrade jwks-rsa from 1.10.1 to 1.11.0 (parse-community#7008)
  fix: upgrade graphql from 15.3.0 to 15.4.0 (parse-community#7011)
  update stale bot (parse-community#6998)
  fix(beforeSave/afterSave): Return value instead of Parse.Op for nested fields (parse-community#7005)
  fix(beforeSave): Skip Sanitizing Database results (parse-community#7003)
  Fix includeAll for querying a Pointer and Pointer array (parse-community#7002)
  Init (parse-community#6999)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

increment('test.name',1) with Parse.Cloud.beforeSave is not work
2 participants